From: Cosimo Cecchi Date: Tue, 18 Feb 2014 04:55:15 +0000 (-0800) Subject: osdWindow: scale by scaleFactor X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2747 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8492f2ba24911fb4553792f10395c3ef5d8ab69a;p=gnome-shell.git osdWindow: scale by scaleFactor Since we calculate this dimensions from the size of the monitor, the result was too large. Scale it by scaleFactor instead. https://bugzilla.gnome.org/show_bug.cgi?id=724607 --- diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js index 1d10f800a..c9cb77d78 100644 --- a/js/ui/osdWindow.js +++ b/js/ui/osdWindow.js @@ -200,8 +200,9 @@ const OsdWindow = new Lang.Class({ let scale = Math.min(scalew, scaleh); this._popupSize = 110 * Math.max(1, scale); + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + this._icon.icon_size = this._popupSize / (2 * scaleFactor); this._box.translation_y = monitor.height / 4; - this._icon.icon_size = this._popupSize / 2; this._box.style_changed(); }, @@ -217,7 +218,10 @@ const OsdWindow = new Lang.Class({ let minWidth = this._popupSize - verticalPadding - leftBorder - rightBorder; let minHeight = this._popupSize - horizontalPadding - topBorder - bottomBorder; - this._box.style = 'min-height: %dpx;'.format(Math.max(minWidth, minHeight)); + // minWidth/minHeight here are in real pixels, + // but the theme takes measures in unscaled dimensions + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + this._box.style = 'min-height: %dpx;'.format(Math.max(minWidth, minHeight) / scaleFactor); }, setMonitor: function(index) {